<?php
/**
 * Created by PhpStorm.
 * User: zhixuan
 * Date: 2019/11/20
 * Time: 12:08
 */

namespace app\admin\validate;


use think\Validate;

class RoleValidate extends Validate
{
    protected $rule =   [
        'role_name'  => 'require',
        'role_privilege_id'  => 'require',
    ];

    protected $message  =   [
        'role_name.require' => '角色名称不能为空',
        'role_name.privilege_id' => '至少选择一个权限',
    ];

    protected $scene = [
        'add'  =>  ['role_name','privilege_id'],
        'edit'  =>  ['role_name','privilege_id'],
    ];
}